library(readxl)
Magnesium <- read_excel("C:/Users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx")
View(Magnesium)
# Importing Data
BRAZIL<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx",sheet = "Sheet1", range = "B1:B264")
# Checking the Imported Data
View(BRAZIL)
# Creating Time Series Data
BRAZIL_ts <- ts(BRAZIL, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
BRAZIL_ts
sum(is.na(BRAZIL_ts))
library(forecast)
BRAZIL_ts <- tsclean(BRAZIL_ts)
BRAZIL_ts
# Identification: Plotting the Time Series Data
plot(BRAZIL_ts)
# Estimating the appropriate model
BRAZIL_ts_model <- auto.arima(BRAZIL_ts)
BRAZIL_ts_model
# Forecasting
options(max.print=1000000)
BRAZIL_ts_forecast <- forecast (BRAZIL_ts_model, level=c(95), h=264)
plot(BRAZIL_ts_forecast)
BRAZIL_ts_forecast
# Exporting
write.table(BRAZIL_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Magnesium/BRAZIL_TSA.csv", sep=",")
# Importing Data
CHINA<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx",sheet = "Sheet1", range = "C1:C264")
# Checking the Imported Data
View(CHINA)
# Creating Time Series Data
CHINA_ts <- ts(CHINA, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
CHINA_ts
sum(is.na(CHINA_ts))
library(forecast)
CHINA_ts <- tsclean(CHINA_ts)
CHINA_ts
# Identification: Plotting the Time Series Data
plot(CHINA_ts)
# Estimating the appropriate model
CHINA_ts_model <- auto.arima(CHINA_ts)
CHINA_ts_model
# Forecasting
options(max.print=1000000)
CHINA_ts_forecast <- forecast (CHINA_ts_model, level=c(95), h=264)
plot(CHINA_ts_forecast)
CHINA_ts_forecast
# Creating Time Series Data
CHINA_ts <- ts(CHINA, start=c(1998,1), end=c(2017,12), frequency=12)
# Viewing and Checking the Created Time Series Data
CHINA_ts
sum(is.na(CHINA_ts))
library(forecast)
CHINA_ts <- tsclean(CHINA_ts)
CHINA_ts
# Identification: Plotting the Time Series Data
plot(CHINA_ts)
# Estimating the appropriate model
CHINA_ts_model <- auto.arima(CHINA_ts)
CHINA_ts_model
# Forecasting
options(max.print=1000000)
CHINA_ts_forecast <- forecast (CHINA_ts_model, level=c(95), h=276)
plot(CHINA_ts_forecast)
CHINA_ts_forecast
# Creating Time Series Data
CHINA_ts <- ts(CHINA, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
CHINA_ts
sum(is.na(CHINA_ts))
library(forecast)
CHINA_ts <- tsclean(CHINA_ts)
CHINA_ts
# Identification: Plotting the Time Series Data
plot(CHINA_ts)
# Estimating the appropriate model
CHINA_ts_model <- auto.arima(CHINA_ts)
CHINA_ts_model
# Forecasting
options(max.print=1000000)
CHINA_ts_forecast <- forecast (CHINA_ts_model, level=c(95), h=264)
plot(CHINA_ts_forecast)
CHINA_ts_forecast
# Exporting
write.table(CHINA_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Magnesium/CHINA_TSA.csv", sep=",")
# Importing Data
ISRAEL<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx",sheet = "Sheet1", range = "D1:D264")
# Checking the Imported Data
View(ISRAEL)
# Creating Time Series Data
ISRAEL_ts <- ts(ISRAEL, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
ISRAEL_ts
sum(is.na(ISRAEL_ts))
library(forecast)
ISRAEL_ts <- tsclean(ISRAEL_ts)
ISRAEL_ts
# Identification: Plotting the Time Series Data
plot(ISRAEL_ts)
# Estimating the appropriate model
ISRAEL_ts_model <- auto.arima(ISRAEL_ts)
ISRAEL_ts_model
# Forecasting
options(max.print=1000000)
ISRAEL_ts_forecast <- forecast (ISRAEL_ts_model, level=c(95), h=264)
plot(ISRAEL_ts_forecast)
ISRAEL_ts_forecast
# Exporting
write.table(ISRAEL_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Magnesium/ISRAEL_TSA.csv", sep=",")
# Importing Data
KAZAKISTAN<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx",sheet = "Sheet1", range = "E1:E264")
# Checking the Imported Data
View(KAZAKISTAN)
# Creating Time Series Data
KAZAKISTAN_ts <- ts(KAZAKISTAN, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
KAZAKISTAN_ts
sum(is.na(KAZAKISTAN_ts))
library(forecast)
KAZAKISTAN_ts <- tsclean(KAZAKISTAN_ts)
KAZAKISTAN_ts
# Identification: Plotting the Time Series Data
plot(KAZAKISTAN_ts)
# Estimating the appropriate model
KAZAKISTAN_ts_model <- auto.arima(KAZAKISTAN_ts)
KAZAKISTAN_ts_model
# Forecasting
options(max.print=1000000)
KAZAKISTAN_ts_forecast <- forecast (KAZAKISTAN_ts_model, level=c(95), h=264)
plot(KAZAKISTAN_ts_forecast)
KAZAKISTAN_ts_forecast
# Exporting
write.table(KAZAKISTAN_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Magnesium/KAZAKISTAN_TSA.csv", sep=",")
# Importing Data
RUSSIA<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx",sheet = "Sheet1", range = "F1:F264")
# Checking the Imported Data
View(RUSSIA)
# Creating Time Series Data
RUSSIA_ts <- ts(RUSSIA, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
RUSSIA_ts
sum(is.na(RUSSIA_ts))
library(forecast)
RUSSIA_ts <- tsclean(RUSSIA_ts)
RUSSIA_ts
# Identification: Plotting the Time Series Data
plot(RUSSIA_ts)
# Estimating the appropriate model
RUSSIA_ts_model <- auto.arima(RUSSIA_ts)
RUSSIA_ts_model
# Forecasting
options(max.print=1000000)
RUSSIA_ts_forecast <- forecast (RUSSIA_ts_model, level=c(95), h=264)
plot(RUSSIA_ts_forecast)
RUSSIA_ts_forecast
# Exporting
write.table(RUSSIA_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Magnesium/RUSSIA_TSA.csv", sep=",")
# Importing Data
UKRAINE<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx",sheet = "Sheet1", range = "G1:G264")
# Checking the Imported Data
View(UKRAINE)
# Creating Time Series Data
UKRAINE_ts <- ts(UKRAINE, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
UKRAINE_ts
sum(is.na(UKRAINE_ts))
library(forecast)
UKRAINE_ts <- tsclean(UKRAINE_ts)
UKRAINE_ts
# Identification: Plotting the Time Series Data
plot(UKRAINE_ts)
# Estimating the appropriate model
UKRAINE_ts_model <- auto.arima(UKRAINE_ts)
UKRAINE_ts_model
# Forecasting
options(max.print=1000000)
UKRAINE_ts_forecast <- forecast (UKRAINE_ts_model, level=c(95), h=264)
plot(UKRAINE_ts_forecast)
UKRAINE_ts_forecast
# Exporting
write.table(UKRAINE_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Magnesium/UKRAINE_TSA.csv", sep=",")
# Importing Data
US<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Magnesium/Magnesium.xlsx",sheet = "Sheet1", range = "H1:H264")
# Checking the Imported Data
View(US)
# Creating Time Series Data
US_ts <- ts(US, start=c(1998,1), end=c(2018,12), frequency=12)
# Viewing and Checking the Created Time Series Data
US_ts
sum(is.na(US_ts))
library(forecast)
US_ts <- tsclean(US_ts)
US_ts
# Identification: Plotting the Time Series Data
plot(US_ts)
# Estimating the appropriate model
US_ts_model <- auto.arima(US_ts)
US_ts_model
# Forecasting
options(max.print=1000000)
US_ts_forecast <- forecast (US_ts_model, level=c(95), h=264)
plot(US_ts_forecast)
US_ts_forecast
# Exporting
write.table(US_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Magnesium/US_TSA.csv", sep=",")
